using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Response.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.Tools;

namespace MinimalistFoodStreet.BackEnd.Server.Server.ResponseExtend.Tables 
{
	public static class AccountsEnitityExtend 
	{
		public static ResponseAccountsDto ToResponseDto(this Account entity)
		{
			return new ResponseAccountsDto ()
			{

					id = entity.AId,
					name = entity.AName,
					avatar = entity.AAvatar,
					account = entity.AAccount,
					email = entity.AEmail,
					phone = entity.APhone,
					endpoint = entity.AEndpoint,
					isBan = entity.AIsBan,
					isActive = entity.AIsActive,
					createTime = entity.ACreateTime,
					createTimeStr = Tools.TimeToString(entity.ACreateTime),
					updateTime = entity.AUpdateTime,
					updateTimeStr = Tools.TimeToString(entity.AUpdateTime),
			};
		}
	}
}